public class Score {
    private Student student;
    private Course course;
    private double score;

    public Score(Student student, Course course, double score) throws InvalidScoreException {
        if (score < 0 || score > 100) {
            throw new InvalidScoreException();
        }
        this.student = student;
        this.course = course;
        this.score = score;
    }

    public Student getStudent() { return student; }
    public Course getCourse() { return course; }
    public double getScore() { return score; }

    @Override
    public String toString() {
        return student.getName() + " - " + course.getName() + ": " + score;
    }
}